package com.juben.svr.mapper;

import com.juben.svr.domain.Conversations;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ConversationMapper {

    Conversations getConversationByID(Integer id);

    void addUnReadCount(@Param("user_id") Integer userId, @Param("toUserId") Integer toUserId);

    Integer selectIdByUser(@Param("fromId") Integer fromId,@Param("toId") Integer toId);
    int insert(Conversations conversation);

    List<Conversations> selectByUserId(Integer userId);
    //删除会话
    int deleteConversation(Integer conversationId);

    void delUnReadCount(@Param("userId") Integer userId, @Param("toUserId") Integer toUserId);

    List<Integer> selectUserIdByUserId(Integer userId);

    void setLastTime(Conversations conversations);


}
